package 继承;

public class Teacher extends Person{
    private int salary;

    public Teacher() {
        //此处自动添加super()
    }

    public Teacher(String name, int age, String sex, int salary) {
        //super前面不能添加任何代码
        super(name, age, sex);
        this.salary = salary;
    }

    public int getSalary() {
        return salary;
    }
}
